package com.mew.lobby.message.response;

import com.mew.common.entity.config.Game;
import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @Author King.Song
 * @Date 2020/12/4 0004
 **/
@Data
@ToString
@NoArgsConstructor
public class GameInfoMessage extends ZebraBaseMessage<GameInfoMessage> {

    private int id;
    private String gameVfx; //VFX
    private int unlockLv;  //解锁登记
    private int roomShow; //是否显示房间：1显示，0不显示
    private int gameType;  //游戏类型：1,喇叭游戏，2，棋牌游戏
    private int seq;       //序号

    @Override
    public void write(ByteBuf b) {
        writeInt(b, this.id);
        writeString(b, this.gameVfx);
        writeInt(b, this.unlockLv);
        writeInt(b, this.roomShow);
        writeInt(b, this.gameType);
        writeInt(b, this.seq);
    }

    @Override
    public GameInfoMessage read(ByteBuf byteBuf) {
        return null;
    }

    public GameInfoMessage buildData(Game game){
        this.id = game.getId();
        this.gameVfx = game.getGameVfx();
        this.unlockLv = game.getUnlockLv();
        this.roomShow = game.getRoomShow();
        this.gameType = game.getGameType();
        this.seq = game.getGameSeq();
        return this;
    }


}
